<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <link rel="stylesheet" type="text/css" href="stylesheet.css">
        <title>Add User</title>
    </head>
    <body>

        <p align="right"><c:out value = "${sessionScope.firstName} ${sessionScope.lastName}" default="" />
            (<a href="login.jsp">Logout</a>)
        </p>

        <h1>Add new user</h1>

        <form method="POST" action="AddUser">
            <div>
                <label>Login: </label><input type="text" name="login" required> <font color="red">*</font></p>
                <label>Password: </label><input type="password" name="password" required> <font color="red">*</font></p>
                <label>Password again: </label><input type="password" name="passwordagain" required> <font color="red">*</font></p>
                <label>E-mail: </label><input type="email" name="email" required> <font color="red">*</font></p>
                <label>First name: </label><input type="text" name="firstname" required> <font color="red">*</font></p>
                <label>Last name: </label><input type="text" name="lastname"required> <font color="red">*</font></p>
                <label>Birthday: </label><input type="text" name="birth" required> <font color="red">*</font> format: yyyy-MM-dd </p>
                <label>Role:</label>
                <select name="role">
                    <option value="User">User</option>
                    <option value="Admin">Admin</option>
                </select><font color="red"> *</font></p>
                <input type="submit" value="Ok" onclick="AddUser" />
                <input  type="button" value="Cancel" onclick="javascript:history.back()" />
            </div>
        </form>
    </td>
</table>
</center>
</body>

<p align="center">
    <span style="color: red">
        <% if ((request.getAttribute("error")) != null) {
                out.println(request.getAttribute("error"));
            }
        %> 
    </span>
</p>


</html>